<%@page import="com.twistinjava.logon.User"%>
<%@page import="java.util.ArrayList"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <table width="680" cellpadding="0" cellspacing="0" border="0" style="padding-top: 50px;padding-left: 30px;">
        <tr>
            <td colspan="3">
                <font style="font-weight: bold;font-size: medium;" color="green">Modify User</font>

            </td>

        </tr>
        <tr>
            <td colspan="3">
                 <div id="waitDiv"></div>
                <html:messages id="msg" message="true">
                    <font size="2">
                        ${msg} </font>
                    <br>
                </html:messages>

            </td>

        </tr>
       
        <tr>
            <td colspan="3">
                &nbsp;

            </td>

        </tr>
        <tr class="header">
            <td>Login ID</td>
            <td>
                First Name
            </td>
            <td>Last Name</td>
            
             <td>Email ID</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
        </tr>
        <%
        ArrayList allUser = (ArrayList)request.getAttribute("allUser");
        String rowColor = null;
        for(int counter=0; counter< allUser.size(); counter++)
        {
        if (counter % 2 == 0)
        {
            rowColor = "white";
        }
        else
        {
            rowColor = "#DDD7D7";
        }
        User user = (User)allUser.get(counter);
        %>
        <tr bgcolor='<%=rowColor%>'>
            <td id="loginIDTD<%=counter%>"><%=user.getLogonID()%></td>
            <td id="fNameTD<%=counter%>"><%=user.getFirstName()%></td>
            <td id="lNameTD<%=counter%>"><%=user.getLastName()%></td>
            <td id="emailTD<%=counter%>"><%=user.getEmail()%></td>
            <td><img src="/images/ico_edit.png" width="30" height="30" alt="Edit" title="Edit" onclick="editUser(<%=user.getId()%>, <%=counter%>);" style="cursor: pointer"></td>
            <td><a href="javascript:deleteUser(<%=user.getId()%>)"><img src="/images/userDelete.png" width="30" height="30" alt="Delete" title="Delete"></a></td>

        </tr>
        <%
        }
        %>

    </table>

